package com.google.code.opengw.policy;

public class PolicyUser {

	private String username;
	private String password;
	private String userRoles;
	
	public PolicyUser(String username, String password, String userRoles) {
		this.username = username;
		this.password = password;
		this.userRoles = userRoles;
	}
	
	public boolean hasRole(String role){
		if(userRoles != null && userRoles.indexOf(role) != -1)
			return true;
		
		return false;
	}

	public String getUsername() {
		return username;
	}

	public void setUsername(String username) {
		this.username = username;
	}

	public String getPassword() {
		return password;
	}

	public void setPassword(String password) {
		this.password = password;
	}

	public String getUserRoles() {
		return userRoles;
	}

	public void setUserRoles(String userRoles) {
		this.userRoles = userRoles;
	}

	@Override
	public String toString() {
		return "PolicyUser [username=" + username + ", password=" + "*****"
				+ ", userRoles=" + userRoles + "]";
	}
	
	
}
